﻿#pragma once
#include <pcl/segmentation/region_growing.h>

#include "./PclPlaneModelModel.h"
#include "pcl/includePcl.h"
#include "../common/BasePclProvider.h"

/// <summary>
/// PclPlaneModelProvider
/// </summary>
class PclPlaneModelProvider : public BasePclProvider
{
    Q_OBJECT

public:
    PclPlaneModelProvider();

public:
    void initEditor(QtTreePropertyBrowser* editor);
    void valueChanged(QtProperty*, double) override;
    void valueChanged(QtProperty*, QString) override;
    void valueChanged(QtProperty*, int) override;
    void valueChanged(QtProperty*, bool) override;
    void valueChanged(QtProperty*, const QColor&) override;
    void close() override;
    void genDataAction();
    void doAction();

    /**
     * @brief Region growing segmentation
     * https://pcl.readthedocs.io/projects/tutorials/en/master/planar_segmentation.html
     * data: Auto Generated
     * @param cloud
     * @param model
     * @return
     */
    void impl(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud, PclPlaneModelModel& model);
};
